Motion control method and apparatus for robot, and robot with the same

ABSTRACT

The present disclosure provides a motion control method and apparatus and a robot with the same. The method includes: obtaining a first rotational angle P 1  of an output shaft of the servo currently at and a first time T 1  for the output shaft of the servo to perform one rotation; obtaining a second rotational angle P 2  for the output shaft of the servo to reach and a second time T 2  for the output shaft of the servo to rotate from the first rotational angle P 1  to the second rotational angle P 2 ; calculating a motion curve B(t) of the output shaft of the servo based on the first rotational angle P 1 , the second rotational angle P 2 , the first time T 1 , and the second time T 2 ; and controlling the servo to rotate according to the motion curve B(t). The present disclosure solves the instability in the gravity center of the robot.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.201711484283.1, filed Dec. 29, 2017, which is hereby incorporated byreference herein as if set forth in its entirety.

BACKGROUND 1. Technical Field

The present disclosure relates to robot technology, and particularly toa motion control method and apparatus for a robot, and a robot with thesame.

2. Description of Related Art

With the advancement of technology, it has become more and more commonto use robots instead of humans to perform a variety of tasks. In orderto make a robot to perform various tasks such as sweeping and dancing ina smooth manner, first of all, the robot has to be made to have a goodmotion capability. The motion of the robot is mainly carried out by themotion of the joints of the robot, and each joint of the robot includesa servo. In which, the servo is a control device for controlling thejoint of the robot to perform various kinds of motion.

The motion of the joints of the robot is usually performed at a constantspeed. For example, assuming that a joint A of the robot is to be movedfrom an angle a to an angle b while the moving time is T, during themovement of the joint A of the robot from the angle a to the angle b,the changing speed of the angle is always |(b−a)/T|. The disadvantage ofthe motion manner of the joint is that, since the robot is in a staticstate at the beginning, if there is a sudden speed, the joint of therobot will be abruptly changed from a stationary state to a motion statewhile the duration ΔT of the changing process is small, and a largechange in the speed of the robot will inevitably lead to a largeacceleration ΔV of the robot which is likely to cause the robot to falldue to the instability in the gravity center.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical schemes in the embodiments of the presentdisclosure more clearly, the following briefly introduces the drawingsrequired for describing the embodiments or the prior art. Apparently,the drawings in the following description merely show some examples ofthe present disclosure. For those skilled in the art, other drawings canbe obtained according to the drawings without creative efforts.

FIG. 1A is a schematic block diagram of three important components of arobot according to an embodiment of the present disclosure.

FIG. 1B is a schematic view of a robot, which is partly cut to show aservo of a joint.

FIG. 1C is an enlarged view of a circle portion C of FIG. 1B.

FIG. 2 is a schematic block diagram of an embodiment of a motion controlapparatus for a robot according to the present disclosure.

FIG. 3 is a schematic block diagram of an embodiment of a robotaccording to the present disclosure.

FIG. 4 is a flow chart of an embodiment of a motion control method for arobot according to the present disclosure.

FIG. 5 is a schematic block diagram of a relationship between onerotation and one turning motion of a servo of a robot according to anembodiment of the present disclosure.

FIG. 6A-FIG. 6B are schematic block diagrams of a motion curve B(t)according to an embodiment of the present disclosure.

FIG. 7 is a schematic block diagram of a change trend of the motioncurve B(t).

FIG. 8A-FIG. 8E are schematic block diagrams of the influence of settingdifferent angle thresholds Y on the shape of the motion curve B(t).

DETAILED DESCRIPTION

In order to make the objects, technical solutions and advantages of thepresent disclosure more clear, the present disclosure will be furtherdescribed in detail below with reference to the accompanying drawingsand embodiments. It should be understood that, the embodiments describedherein are merely illustrative of the present disclosure and are notintended to limit thereto.

FIG. 1A is a schematic block diagram of three important components of arobot according to an embodiment of the present disclosure; FIG. 1B is aschematic view of a robot, which is partly cut to show a servo of ajoint: FIG. 1C is an enlarged view of a circle portion C of FIG. 1B. Forbetter illustrating the embodiments of the present disclosure, threeimportant parts for controlling the movement of one joint of a robot 100are first introduced. When the robot 100 performs a complicated motion,multiple joints may be required for performing combined motion. As shownin FIG. 1A-FIG. 1C, the three important parts are: a robot server 110, arobot joint control system 120, and a robot joint 130, in which therobot joint 130 includes a servo 131. When the robot server 110 is tocontrol the robot joint 130 to perform a motion within a specifiedperiod of time, that is, when an output shaft 1311 of the servo 131 isto be controlled to rotate from a current rotational angle to aspecified target rotational angle within a specified period of time, therobot server 110 will transmit a control instruction to the robot jointcontrol system 120. As used therein, for example, the controlinstruction may be an instruction to rotate the output shaft 1311 of theservo 131 to the target rotational angle in the period of time. Afterreceiving the control instruction, the current rotational angle of theoutput shaft 1311 of the controlled servo 131 is obtained first, then arotation path of the robot joint 130 is calculated based on the targetrotational angle and the period of time in the control instruction, andfinally the output shaft 1311 of the servo 131 is controlled to rotateaccording to the rotation path. For example, during a time T1, the robotjoint 130 is controlled to rotate from angle a₁ to angle a₂. Thetechnical solution of the present disclosure will be described below byway of specific embodiments.

Embodiment 1

FIG. 2 is a schematic block diagram of an embodiment of a motion controlapparatus 200 for a robot according to the present disclosure. As shownin FIG. 2, in Embodiment 1, the motion control apparatus 200 for a servoof a robot includes an obtaining unit 210, a calculating unit 220, and acontrolling unit 230. Each of the above-mentioned units may beimplemented in the form of hardware (e.g., a circuit), software (e.g., aprogram), or a combination thereof (e.g., a circuit with a single chipmicrocomputer). The apparatus 200 may include one or more processors201, a storage 202 (e.g., a memory), and one or more computer programs203 stored in the storage 202 and executed by the processor 201, wherethe one or more computer programs 203 include the above-mentioned units.The apparatus 200 is installed in a robot with a servo. The servo isdriven by a motor, and may be used as a joint of the robot so as torealize the movement of a limb of the robot which connected to thejoint. The movement of the servo specifically means the rotation of anoutput shaft of the servo which is driven by the motor.

The obtaining unit 210 is configured to obtain a first rotational angleP₁ of an output shaft of the servo currently at, a second rotationalangle P₂ for the output shaft of the servo to reach, a first time T₁ forthe output shaft of the servo to perform each rotation, and a secondtime T₂ for the output shaft of the servo to rotate from the firstrotational angle P₁ to the second rotational angle P₂. The rotation fromthe first rotational angle P₁ to the second rotational angle P₂ isdivided into N times with each time rotating a determined number ofdegrees.

The calculating unit 220 is configured to calculate a motion curve B(t)of the output shaft of the servo based on the first rotational angle P₁,the second rotational angle P₂, the first time T₁, and the second timeT₂, where the motion curve B(t) indicates every reached rotational angleof the output shaft of the servo during the second time T₂; the slope ofeach point on the motion curve B(t) has the same sign as a first slopeK₁, where the first slope K₁ is the slope of uniform motion determinedbased on the second rotational angle P₂, the first rotational angle P₁,the second time T₂, and the first time T₁; and an absolute value of theslope of the motion curve B(t) at a start rotation phase and an endrotation phase of the servo is less than an absolute value of the firstslope K₁.

The controlling unit 230 is configured to control the servo to rotateaccording to the motion curve B(t).

Since the rotation of the output shaft of the servo of the robot isusually performed at a constant speed, when the servo of the robotstarts to rotate and ends the rotation, it is easy to cause the robot tolose its gravity center and fall due to the speed changes much and fast.This embodiment provides a motion control apparatus for a robot, whichre-plans the rotation path of the servo, converts the original constantspeed straight rotation path into a curved rotation path, so that therobot has a less speed and speed change in the beginning and the endingof rotation, which reduces the possibility of the falling of the robotdue to instability in the gravity center caused by a sudden change inspeed.

In this embodiment, the calculating unit 220 includes: an anglethreshold calculating unit configured to set an angle threshold Y basedon the first rotational angle P₁ and the second rotational angle P₂; anintermediate angle calculating unit configured to determine a thirdrotational angle P₃ based on a sum of the first rotational angle P₁ andthe angle threshold Y, and determine a fourth rotational angle P₄ basedon a difference between the second rotational angle P₂ and the anglethreshold; a rotation number calculating unit configured to determine afirst number N of the motion curve B(t) through dividing the second timeT₂ by the first time T₁, where the first number N is a total rotationnumber for the output shaft of the servo to rotate from the firstrotational angle P₁ to the second rotational angle P₂; and a motioncurve calculating unit configured to calculate the motion curve B(t) ofthe output shaft of the servo based on the first rotational angle P₁,the second rotational angle P₂, the third rotational angle P₃, thefourth rotational angle P₄, and the first number N through the followingformula:

B(t) = (1 − t)³ × P₁ + 3(1 − t)² × t × P₃ + 3(1 − t) × t² × P₄ + t³ × P₂${n \in \lbrack {1,N} \rbrack},{t = {\frac{n}{N}.}}$

In this embodiment, the angle threshold calculating unit includes: adifference calculating unit configured to calculate a difference betweenthe second rotational angle P₂ and the first rotational angle P₁; and athreshold setting unit configured to set the angle threshold Y, wherethe angle threshold Y is not greater than 10% of the difference.

It should be noted that, the motion control apparatus for a robot in thesecond embodiment of the present disclosure and the motion controlmethod for a robot in the first embodiment of the present disclosure arebased on the same inventive concept, and the corresponding technicalcontents in the apparatus (device) embodiments and method embodimentscan be applied to each other, which will not be detailed herein.

Embodiment 2

FIG. 3 is a schematic block diagram of an embodiment of a robot 300according to the present disclosure. As shown in FIG. 3, in Embodiment2, the robot 300 includes a processor 330, a storage 310 (e.g., amemory), a computer program 320 stored in the storage 310 and executableon the processor 330, and at least a servo 340. The computer program 320includes instructions for implementing the steps in a motion controlmethod or the functional units in a motion control apparatus. When theprocessor 330 executes (the instructions in) the computer program 320,the steps in an embodiment of a motion control method for a robot suchas steps S101-S103 shown in FIG. 4 are implemented, or the functions ofthe units in an embodiment of a motion control apparatus 200 for a robotsuch as the units 210-230 shown in FIG. 2 are implemented. The servo 340is driven by a motor, and may be used as a joint of the robot so as torealize the movement of a limb of the robot which connected to thejoint, where the movement of the servo 340 specifically means therotation of an output shaft of the servo 340 which is driven by themotor.

Exemplarily, the computer program 320 can be divided into one or moreunits, where the one or more units are stored in the storage 310 andexecuted by the processor 330 so as to implement the present disclosure.The one or more units may be a series of computer program instructionsegments capable of performing a particular function, where theinstruction segments for describing the execution process of thecomputer program 320 in the robot 300. For example, the computer program320 can be divided into an obtaining unit, a calculating unit and acontrolling unit, and the specific functions of each unit are asfollows:

the obtaining unit is configured to obtain a first rotational angle P₁of an output shaft of the servo currently at and a first time T₁ for theoutput shaft of the servo to perform one rotation, and obtain a secondrotational angle P₂ for the output shaft of the servo to reach and asecond time T₂ for the output shaft of the servo to rotate from thefirst rotational angle P₁ to the second rotational angle P₂;

the calculating unit is configured to calculate a motion curve B(t) ofthe output shaft of the servo based on the first rotational angle P₁,the second rotational angle P₂, the first time T₁, and the second timeT₂, where the motion curve B(t) indicates every reached rotational angleof the output shaft of the servo during the second time T₂; the slope ofeach point on the motion curve B(t) has the same sign as a first slopeK₁, where the first slope K₁ is the slope of uniform motion determinedbased on the second rotational angle P₂, the first rotational angle P₁,the second time T₂, and the first time T₁; and an absolute value of theslope of the motion curve B(t) at a start rotation phase and an endrotation phase of the servo is less than an absolute value of the firstslope K₁; and

the controlling unit is configured to control the servo to rotateaccording to the motion curve B(t).

It can be understood by those skilled in the art that FIG. 3 is merelyan example of the robot 300 and does not constitute a limitation on therobot 300, and may include more or fewer components than those shown inthe figure, or a combination of some components or different components.

The processor 330 may be a central processing unit (CPU), or be othergeneral purpose processor, a digital signal processor (DSP), anapplication specific integrated circuit (ASIC), a field-programmablegate array (FPGA), or be other programmable logic device, a discretegate, a transistor logic device, and a discrete hardware component. Thegeneral purpose processor may be a microprocessor, or the processor mayalso be any conventional processor.

The storage 310 may be an internal storage unit of the robot 300, forexample, a hard disk or a memory of the robot 300. The storage 310 mayalso be an external storage device of the robot 300, for example, aplug-in hard disk, a smart media card (SMC), a secure digital (SD) card,flash card, and the like, which is equipped on the robot 300.Furthermore, the storage 310 may further include both an internalstorage unit and an external storage device, of the robot 300. Thestorage 310 is configured to store the computer program and otherprograms and data required by the robot 300. The storage 310 may also beused to temporarily store data that has been or will be output.

Embodiment 3

FIG. 4 is a flow chart of an embodiment of a motion control method for arobot according to the present disclosure. The motion control method isapplied to a servo of a robot, where the servo is driven by a motor, andmay be used as a joint of the robot so as to realize the movement of alimb of the robot which connected to the joint. In this embodiment, themethod is a computer-implemented method executable for a processor,which may be implemented through a motion control apparatus for a robotshown in FIG. 2. As shown in FIG. 4, the method includes the followingsteps.

S101: obtaining a first rotational angle P₁ of an output shaft of theservo of the robot currently at and a first time T₁ for the output shaftof the servo to perform one rotation, and obtaining a second rotationalangle P₂ for the output shaft of the servo to reach and a second time T₂for the output shaft of the servo to rotate from the first rotationalangle P₁ to the second rotational angle P₂.

One rotation refers to the rotation of the output shaft of the servomade in response to a control instruction. In this embodiment, the firstrotational angle P₁ at which the servo of the robot is currently locatedand the first time T₁ required for the output shaft of the servo toperform one rotation are obtained.

The movement of the robot is realized by the rotation of the outputshaft of the servo of the robot. By controlling the servo of the robotto rotate, the robot can present postures such as walking and dancing.In which, the servo is a position servo drive, which includes a motor, areducer and an output shaft. To enable the servo to rotate is to enablethe output shaft to rotate. Except for supplying power to a circuit ofthe servo, it also needs to apply a target position instruction toenable the output shaft of the servo to rotate to an angle specified bythe target position instruction. At the same time, the rotationdirection of the servo is also fixed, that is, a servo can only rotatein a left-right direction or a front-rear direction, for example,controlling an arm of the robot to swing from left to right or fromfront to back through the servo. In the case of performing a morecomplex turning motion (one turning motion includes a plurality ofrotations, where each of the rotations refers to the rotation of theoutput shaft of the servo made in response to a control instruction),for example, controlling the arm of the robot to rotate to the frontleft, two servos are required. In addition, the rotational angle of theoutput shaft of the servo is also limited, and the maximum rotationalangles of output shafts of servos in different joints are different. Afirst rotational angle P₁ at which the servo of the robot is currentlylocated is obtained, where the first rotational angle P₁ is an angle atwhich the servo is located before the servo begins to rotate.

During the rotation of the servo, the rotation from a starting angle toa target angle usually needs multiple rotations, that is, the rotationfrom the first rotational angle P₁ to the second rotational angle P₂usually needs multiple rotations, and the first time T₁ indicates thetime needed for the output shaft of the servo to perform one rotation diduring an actual rotation. In this embodiment, the first time T₁ isequal to a servo response time t₁ of the servo, where the servo responsetime t₁ is the minimum time needed for the output shaft of the servo toperform one rotation di operation, and the servo response time t₁ isdetermined by a servo processor of the servo. Due to different servoprocessor having different performance, the servo response time t₁depends on the adopted servo processor. The first time T₁ can be setaccording to the servo response time t₁ and the actual demand. If thefirst time T₁ is greater than the servo response time t₁, it takes alonger time for the output shaft of the servo to rotate once, whichmakes the robot look slower. In general, the robot is expected to beable to complete a turning motion or a rotation quickly and flexibly,rather than slowly completing a turning motion or a rotation. Hence, aslong as it is within a range which the servo can respond in time, thatis, the time for the output shaft of the servo to complete one rotationis not less than the servo response time t₁ and as close as possible tothe servo response time t₁, the servos can respond normally. Conversely,if the first time T₁ is less than the servo response time t₁, it isclear that the servo will not be able to complete the rotation di duringthe first time T₁, which depends on the performance of the servoprocessor. Since the servo response time t₁ is the minimum time requiredfor the output shaft of the servo to perform a rotation, if the firsttime T₁ is less than the servo response time t₁, it is likely that aservo control system of the servo manages to control the servo tocomplete one rotation within the first time T₁ while the servo processorlimits the servo to realize such a rapid rotation, which results indamage to the servo. Therefore, in this embodiment, the first time T₁ isequal to the servo response time t₁, so as to guarantee that the servoof the robot can safely complete one rotation in the shortest time, sothat the servo can reach the target angle in a fast and safe mannerafter multiple rotations.

In this embodiment, a second rotational angle P₂ that requires the servoto reach and a second time T₂ for the output shaft of the servo torotate from the first rotational angle P₁ to the second rotational angleP₂ are obtained.

The second rotational angle P₂ that requires the servo to reach isobtained, where the second rotational angle P₂ is a target angle to bereached by the servo to complete a turning motion. In which, one turningmotion of the servo includes multiple rotations. FIG. 5 is a schematicblock diagram of a relationship between one rotation and one turningmotion of a servo of a robot according to an embodiment of the presentdisclosure. As shown in FIG. 5, the rotation of the output shaft of theservo of the robot from the first rotational angle P₁ to the secondrotational angle P₂ can not be completed in one rotation, which needsmultiple rotations, that is, the servo needs to be rotated from thefirst rotational angle P₁ to an intermediate rotational angle P₃ first,and rotated from the intermediate rotational angle P₃ to anotherintermediate rotational angle P₄, and finally reach the target angle,that is, the second rotational angle P₂, through multiple rotations.

The second time T₂ for the output shaft of the servo to rotate from thefirst rotational angle P₁ to the second rotational angle P₂ is set. Inwhich, the second time T₂ is the total time required for the outputshaft of the servo to complete a certain motion, for example, if thetotal time for the output shaft of the servo to complete a certainmotion, that is, the second time T₂, is set as 1 second, and the firsttime T₁ required for the output shaft of the servo to complete onerotation is 20 milliseconds, where 1 second is equal to 1000milliseconds, and the number of rotations for the output shaft of theservo to complete the motion is T₂/T₁=50, that is, the servo needs to berotated 50 times to complete the motion.

S102: calculating a motion curve B(t) of the output shaft of the servobased on the first rotational angle P₁, the second rotational angle P₂,the first time T₁, and the second time T₂.

In this embodiment, the motion curve B(t) is a rotation curve of theservo, and the servo will be rotate according to a path planned by therotation curve B(t). FIG. 6A-FIG. 6B are schematic block diagrams of amotion curve B(t) according to an embodiment of the present disclosure,which is only an example of the shape of the motion curve, and the shapeof the motion curve eventually obtained through calculation is dependedon the set parameter(s) in the motion curve B(t). As shown in FIG.6A-FIG. 6B, the horizontal axis represents the time with the unit of 20milliseconds (ms), for example, the specific time indicated by the timeof 10 is 10*20 ms=200 ms, and the vertical axis represents the anglewith the unit of 1°, that is, the motion curve B(t) is used to indicatethe angle to which the servo is moved at each time within the secondtime T₂, for example, the point L indicates that the servo is at theangle of 40° at the time 20*20 ms=400 ms.

The slope of each point on the motion curve B(t) has the same sign as afirst slope K₁, and the first slope K₁ is a slope when the servo is at aconstant speed motion which is determined based on the second rotationalangle P₂, the first rotational angle P₁, the second time T₂, and thefirst time T₁, and an absolute value of the slope of the motion curveB(t) when the servo is at a start rotation phase and an end rotationphase is less than an absolute value of the first slope K₁. In which,the constant speed motion of the servo refers to the angle of eachrotation of the output shaft of the servo changes uniformly with time;the start rotation phase of the servo refers to a period of time afterthe servo begins to move from the current position, and the length ofthe time is not specifically limited; the end rotation phase refers to aperiod of time at and before the end of the movement of the servo, andthe length of the time is not specifically limited. For example, asshown in FIG. 6A, if the first rotational angle P₁ is 30°, the secondrotational angle P₂ is 90°, the first time T₁ is 20 milliseconds, andthe second time T₂ is 1.5 seconds (1500 milliseconds), the rotationnumber N=(T₂/T₁)=75 is calculated through the first time T₁ and thesecond time T₂ first, that is, the rotation from the first rotationalangle P₁ to the second rotational angle P₂ needs 75 rotations, and thenthe first slope K₁ when the servo is at the constant speed motion(P₂−P₁)/N=(90−30)/75=0.8 (degrees/time) is calculated based on thesecond rotational angle P₂, the first rotational angle P₁, and therotation number N, that is, 0.8° per rotation. In addition, the slope ofthe first slope K₁ is a positive value, hence the slope of each point onthe motion curve B(t) is positive. For another example, as shown in FIG.6B, if the first rotational angle P₁ is 90°, the second rotational angleP₂ is 30°, the first time T₁ is 20 milliseconds, and the second time T₂is 1.5 seconds (1500 milliseconds), the rotation number N=(T₂/T₁)=75 iscalculated through the first time T₁ and the second time T₂ first, thatis, the rotation from the first rotational angle P₁ to the secondrotational angle P₂ needs 75 times of rotations, and then the firstslope K₁ when the servo is at the constant speed motion(P₂−P₁)/N=(30−90)/75=−0.8 (degrees/time) is calculated based on thesecond rotational angle P₂, the first rotational angle P₁, and therotation number N, that is, 0.8° per rotation. In addition, the slope ofthe first slope K₁ is a negative value, hence the slope of each point onthe motion curve B(t) is negative. Assume that the start rotation phaseis the period from the time 0 to the time 10, and the end motion phaseis the period from the time 75 to the time 65, then regardless ofwhether the value of the first slope K₁ is positive or negative, it canbe seen from FIG. 6A-FIG. 6B that the absolute value of the slope of themotion curve B(t) when the servo is at the start motion phase and theend motion phase is less than the absolute value of the first slope K₁of 0.8.

S103: controlling the output shaft of the servo to rotate according tothe motion curve B(t).

Based on the calculated motion curve B(t), the servo is controlled torotate according to the rotation path planned by the motion curve B(t).Since the absolute value of the slope of the motion curve B(t) when theservo is at the start motion phase and the end motion phase is less thanthe absolute value of the first slope K₁, when the servo starts motionand ends motion, the robot will not fall due to the speed suddenlydropping to zero.

Since the rotation of the output shaft of the servo of the robot isusually performed at a constant speed, when the servo of the robotstarts to rotate and ends the rotation, it is easy to cause the robot tolose its gravity center and fall due to the speed changes much and fast.This embodiment provides a motion control method for a robot, whichre-plans the rotation path of the servo, converts the original constantspeed straight rotation path into a curved rotation path, so that therobot has a less speed and speed change in the beginning and the endingof rotation, which reduces the possibility of the falling of the robotdue to instability in the gravity center caused by a sudden change inspeed.

In one embodiment, the motion curve B(t) includes a slope increase phaseand a slope decrease phase. The method further includes setting theslope increase phase and the slope decrease phase according to a changetrend of an absolute value of the slope of the points on the motioncurve B(t), where: in the slope increase phase, a difference between anabsolute value of the slope of any current point on the motion curveB(t) and an absolute value of the slope of its next point is negative,and the difference is greater than the first threshold value V₁; and inthe slope decrease phase, a difference between an absolute value of theslope of any current point on the motion curve B(t) and an absolutevalue of the slope of its next point is positive, and the difference isless than the second threshold value V₂.

The first threshold value V₁ and the second threshold value V₂ arevalues for controlling that the motion curve B(t) does not appear alarge abrupt change, that is, by setting the first threshold value V₁and the second threshold value V₂, the absolute value of the slope ofthe motion curve B(t) gradually increases first, and then graduallydecreases. The values of the first threshold V₁ and the second thresholdV₂ are relatively small values, and may be set according to the specificconditions of the servo such as the servo response time t₁ or themaximum rotational angle of the output shaft of the servo. The absolutevalues of the first threshold V₁ and the second threshold V₂ may or maynot be equal. For example, if the first threshold V₁ is set to −0.1, andthe second threshold V₂ is set to 0.1; in the slope increase phase, theabsolute value of the slope of a point P_(n) on the motion curve B(t) is0.2, the absolute value of the slope of the next point P_(n+1) is 0.26,and the difference of the absolute values of the slopes of the twopoints is −0.06, which is greater than the first threshold V₁; in theslope decrease phase, the absolute value of the slope of a point P_(n)on the motion curve B(t) is 0.26, the absolute value of the slope of thenext point P_(n+1) is 0.2, and the difference of the absolute values ofthe slopes of the two points is 0.06, which is less than the secondthreshold V₂.

In this embodiment, the step S102 of calculating the motion curve B(t)of the output shaft of the servo based on the first rotational angle P₁,the second rotational angle P₂, the first time T₁, and the second timeT₂ includes: calculating the motion curve B(t) of the output shaft ofthe servo by using the Bezier curve algorithm based on the firstrotational angle P₁, the second rotational angle P₂, the first time T₁,and the second time T₂.

There are many algorithms for calculating the motion curve B(t), forexample, the trapezoidal curve algorithm and the S-curve algorithm.However, it will be more complicated to obtain the motion curve B(t)with the above-mentioned characteristics via the S-curve algorithm, andit will also do not have a good effect to obtain the motion curve B(t)with the above-mentioned characteristics via the trapezoidal curvealgorithm. Therefore, in the case of taking the effects and complexityof the algorithm into account, in this embodiment, the Bezier curvealgorithm is adopted to calculate the motion curve B(t). The Beziercurve algorithm is a simple algorithm for determining curves, which canbe used to draw a smooth curve based on four points. In which, the fourpoints include: starting point X₁, target point X₄, and two intermediatecontrol points X₂ and X₃, where the starting point X₁ and the targetpoint X₄ are two constants, and the two intermediate control points X₂and X₃ are variables, and the shape of the Bezier curve can be changedby changing the values of X₂ and X₃. The calculation formula for Besselthird-order curve is as follows:B(t)=(1−t)³ ×X ₁+3(1−t)² ×t×X ₂+3(1−t)×t ² ×X ₃ +t ³ ×X ₄ t∈[0,1].

In this embodiment, the starting point is the first rotational angle P₀,the target point is the second rotational angle P₂, and the two controlpoints are set to P₃ and P₄, where the values of the two control pointsP₃ and P₄ are also angle values, then calculating the motion curve B(t)of the output shaft of the servo based on the first rotational angle P₁,the second rotational angle P₂, the first time T₁, and the second timeT₂ includes:

Step 1: setting an angle threshold Y based on the first rotational angleP₁ and the second rotational angle P₂.

The angle threshold Y is used to calculate the angles of the two controlpoints P₃ and P₄, which can be set according to specific conditions. Thesizes of the control points P₃ and P₄ obtained through different anglethresholds Y are different, thus the shapes of the obtained motioncurves B(t) are different. In this embodiment, regardless of whether theangle threshold Y is set, as long as the motion curve that eventuallyobtained by calculation has the characteristics described above.

Step 2, determining a third rotational angle P₃ based on a sum of thefirst rotational angle P₁ and the angle threshold Y, and determining afourth rotational angle P₄ based on a difference between the secondrotational angle P₂ and the angle threshold.

In this embodiment, in order to make the starting point to graduallyapproach the target point, it is necessary to set the values of the twocontrol points P₃ and P₄ as the intermediate values of the startingpoint P₁ and the target point P₂, that is, P₃>P₁, P₄<P₂. If the valuesof the two control points P₃ and P₄ are the values of two sides of thestarting point and the target point, that is, P₃<P₁, P₄>P₂, then theobtained motion curve is likely to be far away from the target pointfirst, that is, the absolute value of the slope is gradually reducedfirst, and then approaches the target point, that is, the absolute valueof the slope gradually is increased first, and then approaches thetarget point after circling around the target point. At this time, theabsolute value of the slope may first decrease and then increase, thespecific change trend is shown in FIG. 7. It can be seen that such acurve does not have the characteristics of the motion curve B(t)required in this embodiment. Therefore, in this embodiment, the thirdrotational angle P₃ is determined based on the sum of the firstrotational angle P₁ and the angle threshold Y, and the fourth rotationalangle P₄ is determined according to the difference between the secondrotational angle P₂ and the angle threshold Y, so as to ensure thecalculated values of the two control points are the values between thestarting point P₁ and the target point P₂. For one example, the firstrotational angle P₁ is 30°, and the second rotational angle P₂ is 90°.The angle threshold Y is set to 30 according to P₁ and P₂, and then thethird rotational angle P₃ is determined as 33° according to the sum ofthe first rotational angle P₁ and the angle threshold Y, and the fourthrotational angle P₄ is determined as 87° according to the differencebetween the second rotational angle P₂ and the angle threshold Y. Foranother example, the first rotational angle P₁ is 90°, and the secondrotational angle P₂ is 30°. The angle threshold Y is set to −3°according to P₁ and P₂, and then the third rotational angle P₃ isdetermined as 87° according to the sum of the first rotational angle P₁and the angle threshold Y, and the fourth rotational angle P₄ isdetermined as 33° according to the difference between the secondrotational angle P₂ and the angle threshold Y.

Step 3: determining a first number N of the motion curve B(t) throughdividing the second time T₂ by the first time T₁.

The first number N is a total rotation number for the output shaft ofthe servo to rotate from the first rotational angle P₁ to the secondrotational angle P₂. For example, the second time T₂ is 1 second, andthe first time T₁ is 20 milliseconds, then the first number N isT₂/T₁=50, that is, the first number N is 50.

Step 4: calculating the motion curve B(t) of the output shaft of theservo based on the first rotational angle P₁, the second rotationalangle P₂, the third rotational angle P₃, the fourth rotational angle P₄,and the first number N through the following formula:

B(t) = (1 − t)³ × P₁ + 3(1 − t)² × t × P₃ + 3(1 − t) × t² × P₄ + t³ × P₂${n \in \lbrack {1,N} \rbrack},{{t = \frac{n}{N}};}$

where, t is the time corresponding to the nth rotation, which is thenormalized time, t=(n T₁)/T₂=n/N, and t∈[0, 1].

In this embodiment, the angle threshold Y is set through the firstrotational angle P₁ and the second rotational angle P₂, and then thevalues of the two control points P₃ and P₄ are obtained based on theangle threshold Y, and then the shape of the motion curve B(t) iscontrolled based on the values of P₃ and P₄.

Preferably, the step of setting the angle threshold Y based on the firstrotational angle P₁ and the second rotational angle P₂ includes:calculating a difference between the second rotational angle P₂ and thefirst rotational angle P₁; and setting the angle threshold Y, where theangle threshold Y is not greater than 10% of the difference.

In this embodiment, the value of the angle threshold Y is set to notexceed 10% of the difference between P₂ and P₁. There is no limit to themagnitude relationship between P₂ and P₁, that is, P₂ may be greaterthan P₁ or less than P₁, that is, the turning motion of the servo may befrom a small angle to a large angle, or from a large angle to a smallangle. For example, if the first rotational angle P₁ is 30° and thesecond rotational angle P₂ is 90°, the difference between P₂ and P₁ is60°, and the maximum value of the calculated angle threshold Y is 60,that is, the optional range of the value of the angle threshold Y is[0°, 6°]; alternatively, if the first rotational angle P₁ is 90°, andthe second rotational angle P₂ is 30°, the difference between P₂ and P₁is −60°, and the maximum value of the calculated angle threshold Y is−6°. At the time, the optional range of the value of the angle thresholdY is [−6°, 0° ]. If the value of the angle threshold Y is greater than10% of the difference between P₂ and P₁, the speed change of theobtained motion curve B(t) during the start motion phase and the endmotion phase of the servo will be greater, and the speed change duringthe start motion phase and the end motion phase of the servo willincrease as the ratio increases. FIG. 8A-FIG. 8E are schematic blockdiagrams of the influence of setting different angle thresholds Y on theshape of the motion curve B(t), which respectively show the trends ofthe change of the motion curve B(t) calculated based on different anglethresholds Y. In which, the four angles P₁-P₄ and the angle thresholds Yin FIG. 8A-FIG. 8E are:

P₁-P₄ in FIG. 8A-FIG. 8E Angle threshold Y P₁: 30, P₃: 30, P₄: 90, P₂:90 0 P₀: 30, P₁: 35, P₂: 85, P₃: 90 5 P₀: 30, P₁: 40, P₂: 80, P₃: 90 10P₀: 30, P₁: 50, P₂: 70, P₃: 90 20 P₀: 30, P₁: 60, P₂: 60, P₃: 90 30

It can be seen from FIG. 8A-FIG. 8E that, if the angle thresholds Y are0 and 5, the absolute values of the slope of the motion curve B(t) atthe start motion phase and the end motion phase of the servo which iscalculated based on P₁-P₄ are less than the first slope value K₁, andthe difference therebetween is large, that is, in comparison withuniform motion, the speed change of the robot in these two phases isrelatively small. As the angle threshold Y increases, the absolute valueof the slope of the motion curve B(t) obtained based on P₁-P₄ which isat the start rotation phase and the end rotation phase of the servobegins to increase, and gradually approaches the first slope K₁. Whenthe angle threshold Y is 20, the obtained value of P₁-P₄ changes in anequal difference, and the obtained motion curve B(t) coincides with thestraight line of uniform motion. If the angle threshold Y is 30, theobtained values of P₂ and P₃ are equal, and the change of the speed ofthe motion curve B(t) at the start rotation phase and the end rotationphase of the servo is relatively large and has exceeded the first slopeK₁. It can be seen that, as the angle threshold increases, the absolutevalue of the slope of the points of the motion curve B(t) at the startrotation phase and the end rotation phase of the servo will increase. Atthe same time, when the values of P₁-P₄ changes in an equal difference,the motion curve B(t) coincides with the straight line of uniformmotion. When the angle threshold increases again, the absolute value ofthe slope of the points of the motion curve B(t) at the start rotationphase and the end rotation phase of the servo will exceed the firstslope K₁, which obviously cannot solve the problem of the too large andtoo fast speed change at the start rotation phase and the end rotationphase of the servo due to uniform motion, and the problem will evenbecome more serious. Therefore, the difference between the secondrotational angle P₂ and the first rotational angle P₁ is calculated, andthe angle threshold Y is set, where the angle threshold Y is not greaterthan 10% of the difference.

The setting of the value of P in FIG. 8A-FIG. 8E are all symmetric, thatis, the difference (P₃−P₁) between P₃ and P₁ and the difference (P₂−P₄)between P₂ and P₄ are the same, because only one angle threshold Y isset. The motion curve B(t) obtained by such setting is also symmetrical.If two angle thresholds Y₁ and Y₂ are set, and the values of Y₁ and Y₂are not equal, then the calculation formula of the two control points P₃and P₄ is:P ₃ =P ₁ +Y ₁P ₄ =P ₂ Y ₂

Since the angle thresholds Y₁ and Y₂ are not equal, the difference(P₃−P₁) between P₃ and P₁ and the difference (P₂−P₄) between P₂ and P₄are not equal, so the obtained motion curve is asymmetrical. However,whether one angle threshold Y is set or the two angle thresholds Y₁ andY₂ are set, as long as the angle threshold not exceeds 10% of thedifference between P₂ and P₁, the motion curve B(t) meeting therequirements can be obtained.

Preferably, the second time T₂ is any integer between 30 times and 100times of the first time T₁.

In this embodiment, the second time T₂ is set to be any integer between30 times and 100 times of the first time T₁, and then the obtainedsecond time T₂ can be more reasonable. For example, the first time T₁ is20 milliseconds, the second time T₂ is any integer between 30 times and100 times of the first time T₁, then the second time T₂ is any integerbetween 600 milliseconds and 2000 milliseconds, which means that thetime required for the output shaft of the servo to complete one turningmotion is between 0.6 seconds and 2 seconds. If the second time T₂ isgreater than 100 times of the first time T₁, for example, the first timeT₁ is 20 milliseconds, and the second time T₂ is 200 times of the firsttime T₁, then the obtained second time T₂ is 20 ms*200=400 ms. At thistime, the robot needs to rotate 200 times to complete one turningmotion, and it takes 4 seconds, which makes the robot seem unresponsive.Meanwhile, if the second time T₂ is less than 30 times of the first timeT₁, for example, the second time T₂ is 10 times of the first time T₁,then the obtained second time is 0.2 seconds. At this time, the robotonly needs to rotate 10 times to complete one turning motion, and ittakes 0.2 seconds, which means that if the robot is to rotate from 30°to 100°, then the robot needs to turn 7° every 0.02 seconds, and such alarge angle is likely to cause the robot to fall due to instability inthe gravity center. Therefore, in this embodiment, the second time T₂ ispreferably set to an integer between 30 times and 100 times of the firsttime T₁.

In the above-mentioned embodiments, the description of each embodimenthas its focuses, and the parts which are not described or mentioned inone embodiment may refer to the related descriptions in otherembodiments.

Those ordinary skilled in the art may clearly understand that, theexemplificative units and steps described in the embodiments disclosedherein may be implemented through electronic hardware or a combinationof computer software and electronic hardware. Whether these functionsare implemented through hardware or software depends on the specificapplication and design constraints of the technical schemes. Thoseordinary skilled in the art may implement the described functions indifferent manners for each particular application, while suchimplementation should not be considered as beyond the scope of thepresent disclosure.

In the embodiments provided by the present disclosure, it should beunderstood that the disclosed method and apparatus for a robot may beimplemented in other manners. For example, the above-mentioned methodand apparatus for a robot embodiment is merely exemplary. For example,the division of units is merely a logical functional division, and otherdivision manner may be used in actual implementations, that is, multipleunits or components may be combined or be integrated into anothersystem, or some of the features may be ignored or not performed.

The units described as separate components may or may not be physicallyseparated. The components represented as units may or may not bephysical units, that is, may be located in one place or be distributedto multiple network units. Some or all of the units may be selectedaccording to actual needs to achieve the objectives of this embodiment.

In addition, each functional unit in each of the embodiments of thepresent disclosure may be integrated into one processing unit, or eachunit may exist alone physically, or two or more units may be integratedin one unit. The above-mentioned integrated unit may be implemented inthe form of hardware or in the form of software functional unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and is sold or used as an independent product, theintegrated unit may be stored in a non-transitory computer-readablestorage medium. Based on this understanding, all or part of theprocesses in the method for implementing the above-mentioned embodimentsof the present disclosure are implemented, and may also be implementedby instructing relevant hardware through a computer program. Thecomputer program may be stored in a non-transitory computer-readablestorage medium, which may implement the steps of each of theabove-mentioned method embodiments when executed by a processor. Inwhich, the computer program includes computer program codes which may bethe form of source codes, object codes, executable files, certainintermediate, and the like. The computer-readable medium may include anyprimitive or device capable of carrying the computer program codes, arecording medium, a USB flash drive, a portable hard disk, a magneticdisk, an optical disk, a computer memory, a read-only memory (ROM), arandom access memory (RAM), electric carrier signals, telecommunicationsignals and software distribution media. It should be noted that thecontent contained in the computer readable medium may be appropriatelyincreased or decreased according to the requirements of legislation andpatent practice in the jurisdiction. For example, in some jurisdictions,according to the legislation and patent practice, a computer readablemedium does not include electric carrier signals and telecommunicationsignals.

The above-mentioned embodiments are merely intended for describing butnot for limiting the technical schemes of the present disclosure.Although the present disclosure is described in detail with reference tothe above-mentioned embodiments, it should be understood by thoseskilled in the art that, the technical schemes in each of theabove-mentioned embodiments may still be modified, or some of thetechnical features may be equivalently replaced, while thesemodifications or replacements do not make the essence of thecorresponding technical schemes depart from the spirit and scope of thetechnical schemes of each of the embodiments of the present disclosure,and should be included within the scope of the present disclosure.

What is claimed is:
 1. A computer-implemented motion control method fora servo of a robot, comprising executing on a processor the steps of:obtaining a first rotational angle P₁ of an output shaft of the servocurrently at and a first time T₁ for the output shaft of the servo toperform one rotation; obtaining a second rotational angle P₂ for theoutput shaft of the servo to reach and a second time T₂ for the outputshaft of the servo to rotate from the first rotational angle P₁ to thesecond rotational angle P₂; calculating a motion curve B(t) of theoutput shaft of the servo based on the first rotational angle P₁, thesecond rotational angle P₂, the first time T₁, and the second time T₂,wherein the motion curve B(t) indicates every reached rotational angleof the output shaft of the servo during the second time T₂; the slope ofeach point on the motion curve B(t) has the same sign as a first slopeK₁, where the first slope K₁ is the slope of uniform motion determinedbased on the second rotational angle P₂, the first rotational angle P₁,the second time T₂, and the first time T₁; and an absolute value of theslope of the motion curve B(t) at a start rotation phase and an endrotation phase of the servo is less than an absolute value of the firstslope K₁; and controlling the servo to rotate according to the motioncurve B(t); wherein the step of calculating the motion curve B(t) of theoutput shaft of the servo based on the first rotational angle P₁, thesecond rotational angle P₂, the first time T₁, and the second time T₂comprises: setting an angle threshold Y based on the first rotationalangle P₁ and the second rotational angle P₂; determining a thirdrotational angle P₃ based on a sum of the first rotational angle P₁ andthe angle threshold Y, and determining a fourth rotational angle P₄based on a difference between the second rotational angle P₂ and theangle threshold; determining a first number N of the motion curve B(t)through dividing the second time T₂ by the first time T₁, wherein thefirst number N is a total rotation number for the output shaft of theservo to rotate from the first rotational angle P₁ to the secondrotational angle P₂; and calculating the motion curve B(t) of the outputshaft of the servo based on the first rotational angle P₁, the secondrotational angle P₂, the third rotational angle P₃, the fourthrotational angle P₄, and the first number N through the followingformula:B(t) = (1 − t)³ × P₁ + 3(1 − t)² × t × P₃ + 3(1 − t) × t² × P₄ + t³ × P₂${n \in \lbrack {1,N} \rbrack},{{t = \frac{n}{N}};}$ andwherein the step of setting the angle threshold Y based on the firstrotational angle P₁ and the second rotational angle P₂ comprises:calculating a difference between the second rotational angle P₂ and thefirst rotational angle P₁; and setting the angle threshold Y, whereinthe angle threshold Y is not greater than 10% of the difference.
 2. Themethod of claim 1, wherein the motion curve B(t) comprises a slopeincrease phase and a slope decrease phase; the method further comprisingsetting the slope increase phase and the slope decrease phase accordingto a change trend of an absolute value of the slope of the points on themotion curve B(t), wherein: in the slope increase phase, a differencebetween an absolute value of the slope of any current point on themotion curve B(t) and an absolute value of the slope of the next pointof the current point is negative, and the difference is greater than afirst threshold value V₁; and in the slope decrease phase, a differencebetween an absolute value of the slope of any current point on themotion curve B(t) and an absolute value of the slope of the next pointof the current point is positive, and the difference is less than asecond threshold value V₂.
 3. The method of claim 1, wherein the secondtime T₂ is any integer between 30 and 100 times of the first time T₁. 4.A motion control apparatus for a servo of a robot, comprising: one ormore processors; a storage; and one or more computer programs stored inthe storage and executed by the one or more processors; wherein themotion control apparatus is installed in the robot, and the one or morecomputer programs comprise: instructions to obtain a first rotationalangle P₁ of an output shaft of the servo currently at and a first timeT₁ for the output shaft of the servo to perform one rotation, and obtaina second rotational angle P₂ for the output shaft of the servo to reachand a second time T₂ for the output shaft of the servo to rotate fromthe first rotational angle P₁ to the second rotational angle P₂;instructions to calculate a motion curve B(t) of the output shaft of theservo based on the first rotational angle P₁, the second rotationalangle P₂, the first time T₁, and the second time T₂, wherein the motioncurve B(t) indicates every reached rotational angle of the output shaftof the servo during the second time T₂; the slope of each point on themotion curve B(t) has the same sign as a first slope K₁, where the firstslope K₁ is the slope of uniform motion determined based on the secondrotational angle P₂, the first rotational angle P₁, the second time T₂,and the first time T₁; and an absolute value of the slope of the motioncurve B(t) at a start rotation phase and an end rotation phase of theservo is less than an absolute value of the first slope K₁; andinstructions to control the servo to rotate according to the motioncurve B(t); wherein the instructions to calculate the motion curve B(t)of the output shaft of the servo based on the first rotational angle P₁,the second rotational angle P₂, the first time T₁, and the second timeT₂ comprise: instructions to set an angle threshold Y based on the firstrotational angle P₁ and the second rotational angle P₂; instructions todetermine a third rotational angle P₃ based on a sum of the firstrotational angle P₁ and the angle threshold Y, and determine a fourthrotational angle P₄ based on a difference between the second rotationalangle P₂ and the angle threshold; instructions to determine a firstnumber N of the motion curve B(t) through dividing the second time T₂ bythe first time T₁, wherein the first number N is a total rotation numberfor the output shaft of the servo to rotate from the first rotationalangle P₁ to the second rotational angle P₂; and instructions tocalculate the motion curve B(t) of the output shaft of the servo basedon the first rotational angle P₁, the second rotational angle P₂, thethird rotational angle P₃, the fourth rotational angle P₄, and the firstnumber N through the following formula:B(t) = (1 − t)³ × P₁ + 3(1 − t)² × t × P₃ + 3(1 − t) × t² × P₄ + t³ × P₂${n \in \lbrack {1,N} \rbrack},{{t = \frac{n}{N}};}$ andwherein the instructions to set the angle threshold Y based on the firstrotational angle P₁ and the second rotational angle P₂ comprise:instructions to calculate a difference between the second rotationalangle P₂ and the first rotational angle P₁; and instructions to set theangle threshold Y, wherein the angle threshold Y is not greater than 10%of the difference.
 5. The apparatus of claim 4, wherein the second timeT₂ is any integer between 30 and 100 times of the first time T₁.
 6. Theapparatus of claim 4, wherein the motion curve B(t) comprises a slopeincrease phase and a slope decrease phase; and the one or more computerprograms further comprise: instructions to set the slope increase phaseand the slope decrease phase according to a change trend of an absolutevalue of the slope of the points on the motion curve B(t), wherein: inthe slope increase phase, a difference between an absolute value of theslope of any current point on the motion curve B(t) and an absolutevalue of the slope of the next point of the current point is negative,and the difference is greater than a first threshold value V₁; and inthe slope decrease phase, a difference between an absolute value of theslope of any current point on the motion curve B(t) and an absolutevalue of the slope of the next point of the current point is positive,and the difference is less than a second threshold value V₂.
 7. A robotcomprising: at least a servo; one or more processors; a memory; and oneor more computer programs stored in the memory and executable on the oneor more processors, wherein the one or more computer programs comprise:instructions for obtaining a first rotational angle P₁ of an outputshaft of the servo currently at and a first time T₁ for the output shaftof the servo to perform one rotation, and obtain a second rotationalangle P₂ for the output shaft of the servo to reach and a second time T₂for the output shaft of the servo to rotate from the first rotationalangle P₁ to the second rotational angle P₂; instructions for calculatinga motion curve B(t) of the output shaft of the servo based on the firstrotational angle P₁, the second rotational angle P₂, the first time T₁,and the second time T₂, wherein the motion curve B(t) indicates everyreached rotational angle of the output shaft of the servo during thesecond time T₂; the slope of each point on the motion curve B(t) has thesame sign as a first slope K₁, where the first slope K₁ is the slope ofuniform motion determined based on the second rotational angle P₂, thefirst rotational angle P₁, the second time T₂, and the first time T₁;and an absolute value of the slope of the motion curve B(t) at a startrotation phase and an end rotation phase of the servo is less than anabsolute value of the first slope K₁; and instructions for controllingthe servo to rotate according to the motion curve B(t); wherein theinstructions for calculating the motion curve B(t) of the output shaftof the servo comprise: instructions for setting an angle threshold Ybased on the first rotational angle P₁ and the second rotational angleP₂; instructions for determining a third rotational angle P₃ based on asum of the first rotational angle P₁ and the angle threshold Y, anddetermine a fourth rotational angle P₄ based on a difference between thesecond rotational angle P₂ and the angle threshold; instructions fordetermining a first number N of the motion curve B(t) through dividingthe second time T₂ by the first time T₁, wherein the first number N is atotal rotation number for the output shaft of the servo to rotate fromthe first rotational angle P₁ to the second rotational angle P₂; andinstructions for calculating the motion curve B(t) of the output shaftof the servo based on the first rotational angle P₁, the secondrotational angle P₂, the third rotational angle P₃, the fourthrotational angle P₄, and the first number N through the followingformula:B(t) = (1 − t)³ × P₁ + 3(1 − t)² × t × P₃ + 3(1 − t) × t² × P₄ + t³ × P₂${n \in \lbrack {1,N} \rbrack},{{t = \frac{n}{N}};}$ andwherein the instructions for setting the angle threshold Y comprise:instructions for calculating a difference between the second rotationalangle P₂ and the first rotational angle P₁; and instructions for settingthe angle threshold Y, wherein the angle threshold Y is not greater than10% of the difference.
 8. The robot of claim 7, wherein the second timeT₂ is any integer between 30 and 100 times of the first time T₁.
 9. Therobot of claim 7, wherein the motion curve B(t) comprises a slopeincrease phase and a slope decrease phase; and the one or more computerprograms further comprise: instructions for setting the slope increasephase and the slope decrease phase according to a change trend of anabsolute value of the slope of the points on the motion curve B(t),wherein: in the slope increase phase, a difference between an absolutevalue of the slope of any current point on the motion curve B(t) and anabsolute value of the slope of the next point of the current point isnegative, and the difference is greater than a first threshold value V₁;and in the slope decrease phase, a difference between an absolute valueof the slope of any current point on the motion curve B(t) and anabsolute value of the slope of the next point of the current point ispositive, and the difference is less than a second threshold value V₂.